package com.example.arouter;

import android.os.Bundle;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.callback.NavCallback;
import com.alibaba.android.arouter.launcher.ARouter;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ARouter.getInstance().build("/test/activity1").navigation(this, new NavCallback() {
            @Override
            public void onArrival(Postcard postcard) {
                Log.e("androidLog","onArrival");
            }

            @Override
            public void onFound(Postcard postcard) {
                super.onFound(postcard);
                Log.e("androidLog","onFound");
            }

            @Override
            public void onLost(Postcard postcard) {
                super.onLost(postcard);
                Log.e("androidLog","onLost");
            }

            @Override
            public void onInterrupt(Postcard postcard) {
                super.onInterrupt(postcard);
                Log.e("androidLog","onInterrupt");
            }
        });
    }
}
